import { defineStore } from 'pinia'
import { ref } from 'vue'

export const usePetStore = defineStore('pet', () => {
  const pet = ref('https://via.placeholder.com/150?text=Default+Pet')

  const updatePet = (newPet: string) => {
    pet.value = newPet
    // 这里应该调用API更新服务器上的宠物形象
    console.log('Pet updated to:', newPet)
  }

  return {
    pet,
    updatePet
  }
})